package medium;
/*
162. 寻找峰值
 */
public class LeeCode162 {

  public static void main(String[] args) {
    System.out.println(new LeeCode162().findPeakElement(new int[]{1, 2, 1, 3, 5, 6, 4}));
  }

  public int findPeakElement(int[] nums) {
    int index = 0;
    for (int i = 1; i < nums.length; i++) {
      if (nums[i] > nums[index]){
        index = i;
      }
    }
    return index;
  }
}
